<demo>
支持手动关闭、自定义关闭时间、HTML
</demo>
<template>
  <Button @click="showToast1">手动关闭</Button>
  <Button @click="showToast2">自定义关闭时间</Button>
  <Button @click="showToast3">支持HTML</Button>
</template>

<script lang="ts">
import Button from '../../lib/Button.vue'
import { openToast } from '../../lib/toast/plugin'
export default {
  components: {
    Button,
  },
  setup(props) {
    const showToast1 = () => {
      openToast(`你好${parseInt(Math.random() * 100)}`, {
        callback: () => {
          console.log('关闭toast')
        },
      })
    }
    const showToast2 = () => {
      openToast(`你好${parseInt(Math.random() * 100)}`, {
        autoClose: 10,
      })
    }
    const showToast3 = () => {
      openToast(`<a href="https://cn.bing.com/">必应</a>`, {
        enableHtml: true,
      })
    }
    return {
      showToast1,
      showToast2,
      showToast3,
    }
  },
}
</script>

<style></style>
